/*
 * @Author: wangdazhuang
 * @Date: 2024-10-17 17:46:11
 * @LastEditTime: 2024-10-17 20:39:05
 * @LastEditors: wangdazhuang
 * @Description: 
 * @FilePath: /pornhub_app/lib/src/views/mine/profit/profit_spread.dart
 */
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pornhub_app/assets/styles.dart';
import 'package:pornhub_app/utils/color.dart';
import 'package:pornhub_app/utils/extension.dart';
import 'package:pornhub_app/views/mine/profit/announcement.dart';

import 'package:pornhub_app/views/mine/profit/profit_header.dart';
import 'package:get/get_utils/src/extensions/widget_extensions.dart';
import 'package:pornhub_app/views/mine/profit/spread_list.dart';

class ProfitSpread extends StatelessWidget {
  const ProfitSpread({super.key});

  _buildTxt(String txt, {bool isRight = false}) {
    return Text(
      txt,
      textAlign: isRight ? TextAlign.right : TextAlign.left,
      style: kTextStyle(COLOR.color_333333, fontsize: 13.w),
    );
  }

  _buildLineHeader() {
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
        _buildTxt("我的好友"),
        _buildTxt("消费/收益"),
        _buildTxt("返佣金额"),
        _buildTxt("时间"),
      ],
    ).marginSymmetric(horizontal: 16.w, vertical: 20.w);
  }

  @override
  Widget build(Object context) {
    return CustomScrollView(slivers: [
      Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisSize: MainAxisSize.min,
        children: [
          const ProfitHeader(),
          const ProfitAnnouncement(),
          _buildLineHeader(),
        ],
      ).sliver,
      const SpreadList(),
    ]);
  }
}
